﻿<%@ Register TagPrefix="cc1" Namespace="GDC.Utility.Web" Assembly="ASBCC.Utility" %>

<%@ Page Language="c#" CodeBehind="ContractInfoInput.aspx.cs" AutoEventWireup="false"
    Inherits="BEGDC.CC.Web.Common.ContractInfoInput" %>

<%@ OutputCache Location="None" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>Customer Input</title>
    <base target="_self" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../css/style_fu.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/calendar.css" type="text/css" rel="stylesheet">

    <%--<script type="text/javascript" src="../JS/ScrollableProcess.js"></script>

    <script type="text/javascript" src="../JS/common.js"></script>--%>

    <script type="text/javascript" src="../JS/calendarcode.js"></script>

    <script type="text/javascript" src="../JS/checkform.js"></script>

    <link href="../css/content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../js/jquery-ui.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(function() {
            $(".datepicker").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                buttonImageOnly: true
            }).attr("readonly","true");
        });
    </script>

</head>
<body>
    <div class="text" id="popupcalendar" style="z-index: 100">
    </div>
    <form id="Form1" method="post" runat="server">
    <h3 class="ev-header-section">
        &nbsp;Contract Information (合同信息)</h3>
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
        <tr class="ev-row2">
            <td class="title" style="width: 200px;">
                <span class="Star">*</span>I. Date of contract:<br/>
                合同日期
            </td>
            <td class="val">
                &nbsp;
                <asp:TextBox ID="tbContractDate" runat="server" CssClass="VALUEBOX datepicker"
                    Exp="[^ ]+" tip="Contract date should not be empty!" width="160"></asp:TextBox>&nbsp; <span id="img1"
                        runat="server">
                        <%--<IMG id="ArrivalDateImg1" style="CURSOR: hand" onclick="showCalendar('Form1','tbContractDate','ArrivalDateImg1',false,1,1,1900,31,12,2100);return false;"
								src="../images/calendar.gif" border="0" name="ArrivalDateImg1">--%>&nbsp;
                    </span>
                <asp:Label ID="lbContractDateReadOnly" runat="server"></asp:Label>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title" style="width: 200px;">
                II. Contract No.:<br/>
                合同号
            </td>
            <td class="val">
                &nbsp;
                <asp:TextBox ID="tbContractNo" runat="server" CssClass="TEXTBOX" MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title" style="width: 200px;">
                III. Products sold under Contract:<br>
                此合同销售的产品
            </td>
            <td class="val">
                &nbsp;
                <asp:TextBox ID="tbContractProducts" runat="server" CssClass="TEXTBOX" MaxLength="30"></asp:TextBox>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title" style="width: 200px;">
                IV. Purpose of trip as referred in sales contract:<br>
                合同中提到的考察目的
            </td>
            <td class="val">
                &nbsp;
                <asp:TextBox ID="tbContractTripPurpose" runat="server" CssClass="TEXTBOX" MaxLength="50"></asp:TextBox>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title" style="width: 200px;">
                V. Contract Quotas:<br>
                合同名额
            </td>
            <td class="val">
                &nbsp;
                <asp:TextBox ID="tbContractQuotas" runat="server" CssClass="TEXTBOX" usage="CheckQuotas();"
                    tip="Contract quotas should be number!" MaxLength="13"></asp:TextBox>
                <asp:Label ID="lbContractQuotasReadOnly" runat="server"></asp:Label>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title" style="width: 200px;">
                VI. Unit Price in Euro to be used in this case:<br/>
                单价
            </td>
            <td class="val">
                &nbsp;
                <asp:TextBox ID="tbUnitPrice" runat="server" CssClass="TEXTBOX" usage="CheckPrice(); "
                    tip="Unit price should be number!" MaxLength="13"></asp:TextBox>
                <asp:Label ID="lbUnitPriceReadOnly" runat="server"></asp:Label>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title" style="width: 200px;">
                <span class="Star">*</span>VII. Budget reserved in Bus Case in Euros:<br>
                预算
            </td>
            <td class="val">
                &nbsp;
                <asp:TextBox ID="tbReservedBudget" runat="server" CssClass="TEXTBOX" usage="num+"
                    tip="Reserve budget can't be empty and should be number!" MaxLength="13"></asp:TextBox>
                <asp:Label ID="lbReservedBudgetReadOnly" runat="server"></asp:Label>
            </td>
        </tr>
        <tr class="ev-row2">
            <%--<td class="title" style="width: 200px;"><!--DWLayoutEmptyCell-->
						&nbsp;</td>--%>
            <td colspan="2" class="padding5 ac">
                <asp:ResourceButton ID="Btn_Save" runat="server" ToolTip="SaveTips" CssClass="btn"
                    Text="Save" />&nbsp;
                <asp:ResourceButton ID="Btn_Close" runat="server" ToolTip="CloseTips" CssClass="btn"
                    Text="Close" />
            </td>
        </tr>
    </table>
    </form>

    <script language="javascript" type="text/javascript">
        function CheckQuotas() {
            var quotas = document.Form1.tbContractQuotas.value;

            if (quotas == '') {
                return true;
            }

            if (isNaN(quotas)) {
                return false;
            }

            if (quotas < 0) {
                return false;
            }

            return true;
        }
        function CheckPrice() {
            var price = document.Form1.tbUnitPrice.value;

            if (price == '') {
                return true;
            }

            if (isNaN(price)) {
                return false;
            }

            if (price < 0) {
                return false;
            }

            return true;
        }
        function OnSave() {
            if (!window.confirm(SaveInfo)) { event.returnValue = false; }
        }
        function OnClose() {
            window.close();
            window.returnValue = 'close';
        }

        //><!--dded by joan 2007-07-07 
        //for mulitple quota and unit price and get budget
        var objQuota = null;
        var objPrice = null;
        var objBudget = null;

        for (var i = 0; i < document.all.length; i++) {
            var obj = document.all[i];

            if (obj.id != null && obj.id.indexOf("tbContractQuotas") >= 0) {
                objQuota = obj;
                continue;
            }
            if (obj.id != null && obj.id.indexOf("tbUnitPrice") >= 0) {
                objPrice = obj;
                continue;
            }
            if (obj.id != null && obj.id.indexOf("tbReservedBudget") >= 0) {
                objBudget = obj;
                continue;
            }
        }
        function OnQuotaChange() {
            if (objQuota != null && objPrice != null && objBudget != null) {
                if (!isNaN(objQuota.value) && !isNaN(objPrice.value))
                    objBudget.value = FloatMulitple(objPrice.value, objQuota.value);

            }
        }
        function OnPriceChange() {
            if (objQuota != null && objPrice != null && objBudget != null) {
                if (!isNaN(objQuota.value) && !isNaN(objPrice.value))
                    objBudget.value = FloatMulitple(objPrice.value, objQuota.value);

            }
        }

        function FloatMulitple(arg1, arg2) {
            var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
            try { m += s1.split(".")[1].length } catch (e) { }
            try { m += s2.split(".")[1].length } catch (e) { }
            return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
        }
        //-->	
    </script>

</body>
</html>
